﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" Culture="th-TH" UICulture="th" AutoEventWireup="true" CodeBehind="PS_NonWorkingDaysEdit.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PS_NonWorkingDaysEdit" %>
<%@ Import Namespace="System.Drawing" %>

<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <title>บันทึกวันหยุดประจำปีงบประมาณ</title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">
            function RowDblClick(sender, eventArgs) {
                alert('fuck');
            }
        </script>
    </telerik:RadCodeBlock>

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." src="../Images/Buttons/loading.gif" style="border: 0px;" /></td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <div class="moduleDivSlim1000" style="margin-top:10px;">
    <div class="moduleDivBottom1000">
        <asp:Panel ID="PanelFilter" runat="server" Width="980px" ScrollBars="Auto">
            <table align="center" width="950px">
                <tr>
                    <td align="left">ภายในปีงบประมาณ :
                  <asp:Repeater runat="server" ID="repeaterYear">
                      <ItemTemplate>
                          <a runat="server" href='<%# Request.Url.ToString().Substring(0, Request.Url.ToString().LastIndexOf("/")) + "/PS_NonWorkingDaysEdit.aspx?BgYear=" + Container.DataItem %>'
                              style='<%# Container.DataItem as int? == SelectedBgYear ? "color:orange; font-weight:bold" : "color:blue" %>'><%#Container.DataItem%></a>&nbsp;
                      </ItemTemplate>
                  </asp:Repeater>
                    </td>  
                </tr>
            </table>
        </asp:Panel>
    </div>
    </div>
        
        <asp:Panel ID="Panel6" runat="server" >
        <table width="1000" cellpadding="0" cellspacing="0" >
            <tr>
                <td valign="top" rowspan="2">
                    <div class="Background980V2" style="width: 100%; margin: 0 0 0 0; padding: 0 0 0 0;">
                        <asp:Panel ID="PanelHeader" runat="server" Height="50px" Width="100%">
                            <table align="center" width="100%">
                                <tr>
                                    <td align="left" class="tableHeader">
                                        <asp:Label ID="lblHeader" Text="รายชื่อวันหยุดประจำปีงบประมาณ" runat="server" Font-Bold="True"></asp:Label>
                                        <% Response.Write(SelectedBgYear.ToString()); %>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        <asp:Panel ID="PanelGrid" runat="server" ScrollBars="Auto">
                             
                                        <telerik:RadGrid
                                            ID="RadGrid1"
                                            runat="server"
                                            AllowAutomaticDeletes="True"
                                            AllowFilteringByColumn="True"
                                            AllowMultiRowEdit="True"
                                            AllowMultiRowSelection="True"
                                            AllowPaging="True"
                                            AllowSorting="True"
                                            AutoGenerateColumns="False"
                                            EnableAJAX="True"
                                            EnableAJAXLoadingTemplate="True" 
                                            Skin="Outlook" >
                                            <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1"
                                                ClientDataKeyNames="Sequence"
                                                CommandItemDisplay="Top"
                                                DataKeyNames="Sequence"
                                                InsertItemPageIndexAction="ShowItemOnCurrentPage"
                                                NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                                <CommandItemTemplate>
                                                    <table width="100%">
                                                        <tr>
                                                            <td>
                                                                <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False"
                                                                    CommandName="InitInsert"
                                                                    Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>"> <img style="border:0px;vertical-align:middle;" alt="" 
                                        src="../Images/Buttons/AddRecord.gif" /> เพิ่มวันหยุดประจำปี</asp:LinkButton>
                                                                &nbsp;&nbsp;
                                                            </td>
                                                            <td align="right"></td>
                                                        </tr>
                                                    </table>
                                                </CommandItemTemplate>
                                                <RowIndicatorColumn>
                                                    <HeaderStyle Width="20px" />
                                                </RowIndicatorColumn>
                                                <ExpandCollapseColumn>
                                                    <HeaderStyle Width="20px" />
                                                </ExpandCollapseColumn>

                                                <Columns>
                                                    <telerik:GridEditCommandColumn
                                                        ButtonType="ImageButton"
                                                        EditText="คลิกเพื่อแก้ไขรายการ"
                                                        ItemStyle-Width="15">
                                                        <ItemStyle Width="15px" />
                                                    </telerik:GridEditCommandColumn>
                                                    <telerik:GridButtonColumn
                                                        ButtonType="ImageButton"
                                                        CommandName="Delete"
                                                        ConfirmDialogType="RadWindow"
                                                        ConfirmText="ลบข้อมูลที่เลือก?"
                                                        ItemStyle-Width="15"
                                                        Text="คลิกเพื่อลบรายการนี้"
                                                        UniqueName="column1">
                                                        <ItemStyle Width="15px" />
                                                    </telerik:GridButtonColumn>
                                                    <telerik:GridBoundColumn
                                                        DataField="Sequence"
                                                        DataType="System.Int32"
                                                        Display="False"
                                                        HeaderText="Sequence"
                                                        ReadOnly="True"
                                                        UniqueName="Sequence"
                                                        Visible="False">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn
                                                        DataField="Date"
                                                        HeaderStyle-HorizontalAlign="Center"
                                                        HeaderText="วันที่"
                                                        DataFormatString="{0:dd/MM/yyyy}"
                                                        UniqueName="Date">
                                                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn
                                                        DataField="Name"
                                                        HeaderStyle-HorizontalAlign="Center"
                                                        FilterControlWidth="100%"
                                                        ShowFilterIcon="false"
                                                        AutoPostBackOnFilter="true"
                                                        HeaderText="วันหยุด"
                                                        UniqueName="Name">
                                                        <HeaderStyle HorizontalAlign="Center" Width="200px" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn
                                                        DataField="Remarks"
                                                        HeaderStyle-HorizontalAlign="Center"
                                                        FilterControlWidth="100%"
                                                        ShowFilterIcon="false"
                                                        AutoPostBackOnFilter="true"
                                                        HeaderText="หมายเหตุ"
                                                        UniqueName="Remarks">
                                                        <HeaderStyle HorizontalAlign="Center" Width="200px" />
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                                <EditFormSettings EditFormType="WebUserControl"
                                                    UserControlName="../UserControls/PS_NonWorkingDaysEdit.ascx">
                                                    <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                                                </EditFormSettings>
                                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                            </MasterTableView>
                                            <ClientSettings
                                                AllowColumnHide="True"
                                                AllowColumnsReorder="True"
                                                EnableRowHoverStyle="True"
                                                ReorderColumnsOnClient="True">
                                                <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                                                <ClientEvents OnRowDblClick="RowDblClick" />
                                            </ClientSettings>
                                        </telerik:RadGrid>

                                        <telerik:RadGrid ID="RadGrid2"
                                            runat="server"
                                            AllowAutomaticDeletes="True"
                                            AllowFilteringByColumn="True"
                                            AllowMultiRowEdit="True"
                                            AllowMultiRowSelection="True"
                                            AllowPaging="True"
                                            AllowSorting="True"
                                            AutoGenerateColumns="False"
                                            EnableAJAX="True"
                                            EnableAJAXLoadingTemplate="True"
                                            GridLines="None" Skin="Outlook"
                                            Width="100%">
                                            <MasterTableView
                                                AllowMultiColumnSorting="True"
                                                CellSpacing="-1"
                                                ClientDataKeyNames="Sequence"
                                                CommandItemDisplay="Top"
                                                DataKeyNames="Sequence"
                                                InsertItemPageIndexAction="ShowItemOnCurrentPage"
                                                NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                                <CommandItemTemplate>
                                                    <table width="100%">
                                                        <tr>
                                                            <td>
                                                                <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False"
                                                                    CommandName="InitInsert"
                                                                    Visible="<%# !RadGrid2.MasterTableView.IsItemInserted && RadGrid2.EditIndexes.Count <= 0 %>">
                                             <img style="border:0px;vertical-align:middle;" alt="" 
                                src="../Images/Buttons/AddRecord.gif" /> เพิ่มหน่วยงาน</asp:LinkButton>
                                                                &nbsp;&nbsp;
                                                            </td>
                                                            <td align="right"></td>
                                                        </tr>
                                                    </table>
                                                </CommandItemTemplate>
                                                <RowIndicatorColumn>
                                                    <HeaderStyle Width="20px" />
                                                </RowIndicatorColumn>
                                                <ExpandCollapseColumn>
                                                    <HeaderStyle Width="20px" />
                                                </ExpandCollapseColumn>
                                                <Columns>
                                                    <telerik:GridEditCommandColumn ButtonType="ImageButton" ItemStyle-Width="15" EditText="คลิกเพื่อแก้ไขรายการ">
                                                        <ItemStyle Width="15px" HorizontalAlign="Center" />
                                                    </telerik:GridEditCommandColumn>
                                                    <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete"
                                                        ConfirmDialogType="RadWindow" ConfirmText="ลบข้อมูลที่เลือก?"
                                                        ItemStyle-Width="15" Text="คลิกเพื่อลบรายการ" UniqueName="column1">
                                                        <ItemStyle Width="15px" HorizontalAlign="Center" />
                                                    </telerik:GridButtonColumn>
                                                    <telerik:GridBoundColumn
                                                        DataField="Sequence"
                                                        DataType="System.Int32"
                                                        Display="False"
                                                        HeaderText="Sequence"
                                                        ReadOnly="True"
                                                        UniqueName="Sequence" Visible="False">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn
                                                        AutoPostBackOnFilter="true"
                                                        DataField="JobSite.Name"
                                                        FilterControlWidth="100%"
                                                        HeaderStyle-HorizontalAlign="Center"
                                                        HeaderText="หน่วยงาน"
                                                        ShowFilterIcon="false"
                                                        UniqueName="JobSite.Name">
                                                        <HeaderStyle HorizontalAlign="Center" Width="200px" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn
                                                        AutoPostBackOnFilter="true"
                                                        DataField="Remarks"
                                                        FilterControlWidth="100%"
                                                        HeaderStyle-HorizontalAlign="Center"
                                                        HeaderText="หมายเหตุ"
                                                        ShowFilterIcon="false" UniqueName="Remarks">
                                                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                                <EditFormSettings EditFormType="WebUserControl"
                                                    UserControlName="../UserControls/PS_NonWorkingJobSites.ascx">
                                                    <EditColumn UniqueName="EditCommandColumn1">
                                                    </EditColumn>
                                                </EditFormSettings>
                                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                            </MasterTableView>
                                            <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True"
                                                EnableRowHoverStyle="True" ReorderColumnsOnClient="True">
                                                <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                                            </ClientSettings>
                                        </telerik:RadGrid>
                                    
                        </asp:Panel>
                    </div>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
